package cn.kow.kmall.dao;

import cn.kow.kmall.core.jpa.BaseJpaRepository;
import cn.kow.kmall.pojo.entity.User;
import org.springframework.data.jpa.repository.Query;

import java.util.Optional;

public interface UserRepository extends BaseJpaRepository<User, Long> {

    Optional<User> findByPhone(String phone);

    Optional<User> findByUid(Long uid);

    @Query("select max(u.uid) from User u")
    Long findMaxUid();
}
